package edu.kaifadui.lmbase.jwt;

import com.auth0.jwt.JWT;
import com.auth0.jwt.algorithms.Algorithm;
import edu.kaifadui.lmbase.pojo.Dev;
import org.springframework.stereotype.Component;

/**
 * @author dualseason
 */
@Component
public class TokenUtil {
    public String getToken(Dev dev) {
        return JWT.create().withAudience(String.valueOf(dev.getAppkey()))
                .sign(Algorithm.HMAC256(dev.getAppsecret()));
    }
}
